package view.components.buttons {
	
	/**
	 * @author Alejandro
	 */
	
	import flash.display.SimpleButton
	
	public class AbstractEstructureButton extends SimpleButton {
		
		public var propertysValues:Object;
				
		public function AbstractEstructureButton(propertysValues_V:Object) {
			this.propertysValues = propertysValues_V;
		}
		
		public function getColorProperty(name:String):uint {
			if (propertysValues.hasOwnProperty(name)) {				
			    return parseInt(propertysValues[name], 16);
			}			
			return DBPropertys[name];
		}
		
		public function getNumberProperty(name:String):Number {
			if (propertysValues.hasOwnProperty(name)) {				
			    return parseInt(propertysValues[name]);
			}			
			return DBPropertys[name];
		}
		
		public function getStringProperty(name:String):String {
			if (propertysValues.hasOwnProperty(name)) {				
			    return propertysValues[name];
			}			
			return DBPropertys[name];
		}
		
		public function getBooleanProperty(name:String):Boolean {
			if (propertysValues.hasOwnProperty(name)) {				
			    if(propertysValues[name] == "false") {
					return false;					
				}
				if(propertysValues[name] == "true") {
					return true;					
				}
			}		
			return DBPropertys[name];
		}
		
		public function get upColor():uint {					
			return getColorProperty("upColor");
		}
		public function get overColor():uint {					
			return getColorProperty("overColor");
		}
		public function get downColor():uint {					
			return getColorProperty("downColor");
		}		
		public function get heightY():Number {				
			return getNumberProperty("height");
		}		
		public function get widthX():Number {				
			return getNumberProperty("width");
		}	
		public function get yy():Number {				
			return getNumberProperty("y");
		}		
		public function get xx():Number {				
			return getNumberProperty("x");
		}
		public function get soundPath():String {
			return getStringProperty("soundPath");
		}			
		public function get useHandCursorT():Boolean {
			return getBooleanProperty("useHandCursor");
		}
		public function get visibleT():Boolean {
			return getBooleanProperty("visible");
		}
		public function get textT():String {
			return getStringProperty("text");
		}
	}
}